package com.diaohw.module.metadata.obj.convert;

import com.diaohw.module.metadata.obj.dto.DictionaryDTO;
import com.diaohw.module.metadata.obj.entity.DictionaryDO;
import com.diaohw.module.metadata.obj.vo.DictionaryVO;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p>
 * 数据字典 类型转换
 * </p>
 *
 * @author D-Hw
 * @since 2024-09-20
 */
@Mapper
public interface DictionaryConvert {

    DictionaryConvert INSTANCE = Mappers.getMapper(DictionaryConvert.class);

    /**
     * dto to entity
     */
    @InheritConfiguration
    DictionaryDO dtoToEntity(DictionaryDTO dto);

    /**
     * entity to dto
     */
    @InheritConfiguration
    DictionaryDTO entityToDto(DictionaryDO entity);

    /**
     * entity to dto
     */
    @InheritConfiguration
    DictionaryVO entityToVo(DictionaryDO entity);

    /**
     * entity to dto
     */
    @InheritConfiguration
    List<DictionaryVO> entityToVo(List<DictionaryDO> list);


}

